/*    */ package handling.login.handler;
/*    */ 
/*    */ import client.LoginCrypto;
/*    */ import com.alibaba.druid.pool.DruidPooledConnection;
/*    */ import database.DatabaseConnection;
/*    */ import java.sql.PreparedStatement;
/*    */ import java.sql.SQLException;
/*    */ 
/*    */ 
/*    */ public class AutoRegister
/*    */ {
/*    */   public static boolean createAccount(String login, String pwd) {
/* 13 */     try (DruidPooledConnection con = DatabaseConnection.getInstance().getConnection()) {
/* 14 */       try (PreparedStatement ps = con.prepareStatement("INSERT INTO accounts (name, password, email, birthday, macs) VALUES (?, ?, ?, ?, ?)")) {
/* 15 */         ps.setString(1, login);
/* 16 */         ps.setString(2, LoginCrypto.hexSha1(pwd));
/* 17 */         ps.setString(3, "autoregister@mail.com");
/* 18 */         ps.setString(4, "0000-00-00");
/* 19 */         ps.setString(5, "00-00-00-00-00-00");
/* 20 */         ps.executeUpdate();
/*    */       } 
/* 22 */       return true;
/* 23 */     } catch (SQLException ex) {
/* 24 */       System.out.println("Ex:" + ex);
/*    */       
/* 26 */       return false;
/*    */     } 
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\handling\login\handler\AutoRegister.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */